home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 120
/
Vol 120.iso
/
games
/
battlefi.swf
/
scripts
/
frame_636
/
PlaceObject2_562_2032
/
CLIPACTIONRECORD onClipEvent(enterFrame).as
next >
Wrap
Text File
|
2010-11-09
|
2KB
|
72 lines
onClipEvent(enterFrame){
if(_root.vic)
{
this._y = 491.2;
}
if(_root.loss)
{
this._y = 491.2;
}
if(!this.hitTest(_root.castlerang))
{
this._x += speed;
}
if(duped && _root.population < _root.poptot)
{
_root.population = _root.population + 1;
_root.gold -= 2000;
i++;
duplicateMovieClip(_root.cat,"ca" + i,16384 + (40000 + i));
_root["ca" + i]._x = -6.399999999999999;
_root["ca" + i]._y = random(50) + 201.7;
duped = false;
}
if(this.hitTest(_root.castlerang) && !attackin)
{
this.gotoAndPlay("attk");
attackin = true;
}
if(this.dead && this._currentframe < 56)
{
this.gotoAndPlay("die");
}
l = 1;
while(l < _root.lvl + 1)
{
if(this.hit.hitTest(_root["a" + l]))
{
this.gotoAndPlay("hurt");
attackin = false;
remaining--;
_root["a" + l].removeMovieClip();
}
l++;
}
if(this.dead)
{
this._x -= speed;
}
if(this.deadfull)
{
this._x = -1000000000;
}
f = 1;
while(f < Math.round(_root.lvl / 2 + 1))
{
if(this.hit.hitTest(_root.castle["th" + f]))
{
this.gotoAndPlay("hurt");
remaining--;
attackin = false;
_root.castle["th" + f].removeMovieClip();
}
f++;
}
if(remaining == 0)
{
this.gotoAndPlay("die");
remaining = 500;
}
this.hp._xscale = remaining / 4 * 100;
}